const mongoose = require('mongoose');
const DictionaryModel = mongoose.models['Dictionary'];
module.exports={
    getDictionary:async function(options){
        let dictionary=await DictionaryModel.findOne({key:options.key});
        if(!dictionary){
            return {value:[]};
        }
        return {value:JSON.parse(dictionary.value)};
    }
};